import Vue from 'vue'
import Router from 'vue-router'
import config from './config'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/Login.vue')
    }, {
      path: '/managers',
      name: 'managers',
      component: () => import('@/views/managers.vue')
    }, {
      path: '/module',
      name: 'module',
      component: () => import('@/views/module.vue')
    }, {
      path: '/students',
      name: 'students',
      component: () => import('@/views/students.vue')
    }, {
      path: '/books',
      name: 'books',
      component: () => import('@/views/books.vue')
    }, {
      path: '/config',
      name: 'config',
      redirect: '/intake',
      component: () => import('@/views/config.vue'),
      children: [].concat(config)
    }, {
      path: '/*',
      redirect: '/login'
    }
  ]
})
